﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CorsatAdminApp.Library.TempTaskClasses;

namespace CorsatAdminApp.Desktop.TempTaskForms
{
    public partial class ItemsForm : Form
    {
        public ItemsForm()
        {
            InitializeComponent();
        }

        private void ItemsForm_Load(object sender, EventArgs e)
        {
            
            // create a temp list to hold some items for ListBox1

            List<CommonItem> tempList = new List<CommonItem>();

            CommonItem tempItem = new CommonItem();
            tempItem.ItemName = "ايبارشية";
            tempItem.ItemId = 1;
            tempList.Add(tempItem);

            tempItem = new CommonItem();
            tempItem.ItemName = "مطرانية";
            tempItem.ItemId = 2;
            tempList.Add(tempItem);

            tempItem = new CommonItem();
            tempItem.ItemName = "كنيسة";
            tempItem.ItemId = 3;
            tempList.Add(tempItem);


            // Set ListBox DataSource
            listBox1.DataSource = tempList;
            listBox1.DisplayMember = "ItemName";
            listBox1.ValueMember = "ItemID";
        }

        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            lblMainItemType.Text = ((CommonItem)listBox1.SelectedItem).ItemName;
        }

    }
}
